﻿using LJX.SmartPark.Common.ResponseOutput;
using LJX.SmartPark.Domain.IotInfo.SmartLamp;
using LJX.SmartPark.Domain.SysManage;
using LJX.SmartPark.Service.IotInfo.SmartLamp;
using LJX.SmartPark.Service.SysManage;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using static LJX.SmartPark.Service.SysManage.CategorySrevice;

namespace LJX.SmartPark.WebApi.Controllers.SysManage
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    [ApiExplorerSettings(GroupName = "SysManage")]
    public class CategoryController : ControllerBase
    {
        private readonly ICategorySrevice _CategoryService;
        public CategoryController(ICategorySrevice CategoryService)
        {
            _CategoryService = CategoryService;
        }
        /// <summary>
        /// 分页显示查询
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [HttpPost]
        public Response<List<Category>> GetCategoryPage(SelectLogs select)
        {
            var result = _CategoryService.GetCategoryPage(select);
            return result.Result;
        }
        /// <summary>
        /// 获取总条数
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [HttpGet]
        public int GetCount()
        {
            return _CategoryService.GetCount();
        }
    }
}
